
public class Main {

	public static void main(String[] args) {
		
		//Grammar g= new Grammar("S->A|B;A->B|e;B->A|b;", "S");
		//Grammar g= new Grammar("S->aAb|SA;A->aA|e|S;", "S");
		//Grammar g= new Grammar("S->A;A->e;", "S");
		//Grammar g= new Grammar("S->AS|A;A->a|B;B->b|S|A;", "S");
		//Grammar g= new Grammar("S->AS|a|B;A->a|b|S|A;B->b|S|A;", "S");
		//Grammar g= new Grammar("S->AB;A->a|e;B->b|e;", "S");
		Grammar g= new Grammar("S->AB;A->aA|a;B->bB|e;", "S");
		
		System.out.println("Grammar");
		System.out.print("VN: ");
		for(String c : g.getVN()){
			
			System.out.print(c);
		}
		System.out.println("");
		
		System.out.print("VT: ");
		for(String b : g.getVT()){
			
			System.out.print(b);
		}
		System.out.println("");

		System.out.println("Production: "+g.getP().getAllProduction());
		

		/*System.out.println("Grammar after FromBelowProcedure");
		Grammar gg= a.FromBelowProcedure(g);

		
		System.out.println("Production: "+gg.getP().getAllProduction());

		System.out.println("Grammar after FromAboveProcedure");
		Grammar ggg= a.FromAboveProcedure(g);

		System.out.println("Production: "+ggg.getP().getAllProduction());*/

		System.out.println("Grammar after EliminateEpsilonProduction");
		Grammar gggg= Algorithm.EliminateEpsilonProductions(g);

		System.out.println("Production: "+gggg.getP().getAllProduction());

		//System.out.println("Grammar after EliminateUnitProduction");
		
		//Algorithm.EliminateUnitProductions(gggg);
		
		//System.out.println("Production: "+gggg.getP().getAllProduction());
		
		//test per verificare la funzione combine di utility
		/*String c= "AB";
		for(String s : Utility.combine(c)){
			
			System.out.println(s);
		}*/

	}

}
